import Fluent
import Vapor

func routes(_ app: Application) throws {
    //userController
    try app.register(collection: UserController())

    let tokenProtected = app
        .grouped(UserAuthenticator())
        .grouped(User.guardMiddleware())
    
    tokenProtected.get("test") { req in
       return "hello"
    }
    
    try tokenProtected.register(collection: FileController())
    

    
    print(app.routes.all)
}
